//
//  MXBaesVC.swift
//  XMPPTest
//
//  Created by 陈学明 on 17/2/9.
//  Copyright © 2017年 muxue. All rights reserved.
//

import UIKit

class MXBaesVC: UIViewController {
    
    var _navBarView:UIView? = nil
    var navBarView:UIView?{
        get{
            if _navBarView == nil {
                _navBarView = UIView(frame:CGRect(x: 0, y: 0, width: UIScreen.main.bounds.size.width, height: 64))
                _navBarView?.backgroundColor = UIColor.orange
                view.addSubview(_navBarView!)
                
                left0 = UIButton(type: .custom)
                left1 = UIButton(type: .custom)
                rigt0 = UIButton(type: .custom)
                rigt1 = UIButton(type: .custom)
                
                _navBarView?.sd_addSubviews([left0!,left1!,rigt0!,rigt1!])
                
                left0?.sd_layout()
                    .topSpaceToView(_navBarView,20)?
                    .leftSpaceToView(_navBarView,0)?
                    .widthIs(50)?
                    .heightIs(44);
                
                left1?.sd_layout()
                    .topSpaceToView(_navBarView,20)?
                    .leftSpaceToView(_navBarView,50)?
                    .widthIs(50)?
                    .heightIs(44);
                
                rigt0?.sd_layout()
                    .topSpaceToView(_navBarView,20)?
                    .rightSpaceToView(_navBarView,0)?
                    .widthIs(50)?
                    .heightIs(44);
                rigt1?.sd_layout()
                    .topSpaceToView(_navBarView,20)?
                    .rightSpaceToView(_navBarView,50)?
                    .widthIs(50)?
                    .heightIs(44);
            }
            return _navBarView
        }
    }
    var _titleText:UILabel? = nil;
    var titleText:UILabel?{
        get{
            if _titleText == nil {
                _titleText = UILabel()
                self.navBarView?.addSubview(_titleText!)
                _titleText?.sd_layout()
                .topSpaceToView(self.navBarView,20)?
                .centerXEqualToView(self.navBarView)?
                .heightIs(44);
                _titleText?.setSingleLineAutoResizeWithMaxWidth(UIScreen.main.bounds.size.width)
            }
            return _titleText;
        }
    }
    var left0:UIButton?
    var left1:UIButton?
    var rigt0:UIButton?
    var rigt1:UIButton?
    
    override func viewDidLoad() {
        super.viewDidLoad()
        view.backgroundColor = UIColor.white
        navigationController?.navigationBar.isHidden = true
    }
    
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    



}
